<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>注册页面</title>
		 <link href="../css/bootstrap.min.css" rel="stylesheet" />
 		 <link rel="stylesheet" type="text/css" href="../fonts/iconfont.css">
 		 <link rel="stylesheet" type="text/css" href="../css/style.css"/>
		<style>
			   *{font-family: "微软雅黑";}
			   body,html{width: 100%;height: 100%;}
			   .navbar{border: none;background-color: #fff;}
			   .nav > li > a{padding-right: 0}
			   .nav_lt_font a{margin-top: 20px;padding-right: 0;font-size: 16px;}
			   .nav_font li{text-align: center;}
			   .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus{background: none;font-weight: bolder}
			  .bg_denglu{width: 100%;height: 100%;background-color: rgba(0,0,0,0.6);overflow: hidden;position: fixed;}
			  .bgImage img{position: absolute;left:0;right: 0;top: 0;bottom: 0;width: 100%;height: 100% }
			  .denglu_user{margin-top: 5%;}
			  .denglu_user h3{border-bottom: 1px solid #eee;margin-bottom: 50px;}
			  .denglu_user h3>span{display: inline-block;padding: 10px 0;border-bottom: 4px solid #6bc50d;font-size: 18px;color: #252525;}
			  .denglu_user h3>a{font-size: 14px;color: #6bc50d;padding-top: 10px;}
			  .denglu_user .form-group{padding: 5px 0;}
			  
			  .btn-success{background-color: #6bc50d;}
			  .btn-success:hover{background-color: #6bc50d;}
			  .btn-success.focus, .btn-success:focus{background-color: #6bc50d;}
			  .regetCode{position: absolute;	left: 10px;width: 100%;color: #6bc50d;cursor: pointer;}
		</style>
	</head>
	<body>
	<nav class="navbar navbar-default" style="margin: 0;">
	  <div class="container" >
		  <div class="navbar-header">
			  <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
				  <span class="sr-only">Toggle navigation</span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
			  </button>
			  <a class="navbar-brand" href="#">
				  <img alt="Brand" src="../img/logo.png" >
			  </a>
		  </div>

	    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	     <ul class="nav navbar-nav nav_lt_font ">
			 <li ><a href="../index.html">首页 <span class="sr-only">(current)</span></a></li>
			 <li><a href="cyzfw_index.html">创业者服务</a></li>
			 <li><a href="touziren_index.html">投资者服务</a></li>
			 <li><a href="javascript:void(0);" class="tutorService">导师服务</a></li>
			 <li><a href="xqfb_index.html">技术需求者</a></li>
			 <li><a href="yixingdasai.html">熠星大赛</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right nav_font">
      <!--<li><a href="#"><i class="iconfont icon-sousuo_sousuo"></i><br>搜索</a></li>-->
      <li><a href="denglu.html"><i class="iconfont icon-zhuce"></i><br>登陆</a></li>
      <li><a href="zhuche.html"><i class="iconfont icon-denglu"></i><br>注册</a></li>
        </li>
      </ul>
	    </div>
	  </div>
	</nav>

	<div class="bg_denglu">
		<div class="row denglu_user">
			<div class="bgImage">
				<img src="../img/loginBg.png">
			</div>
			<div class="col-xs-8 col-xs-offset-2" style="background-color: #fff;padding-bottom: 50px;">
				<h3><span>用户注册</span><a class="pull-right" href="denglu.html">使用已有账号登录</a></h3>
				<div class="row">
					<div class="col-xs-offset-4 col-xs-4">
						<form class="form-horizontal" action="http://114.112.96.184:18080/sys/register">
						  <div class="form-group">
						    <label class="sr-only">Email address</label>
						    <input type="tel" class="form-control" name="username" class="inputxt"  datatype="m"  sucmsg="用户名验证通过！" nullmsg="请输入用户名！" errormsg="手机号码注册！" id="phoneNumbar" placeholder="手机号码" value="">
						  </div>
						  <div class="form-group">
						    <label class="sr-only" for="password">Password</label>
						    <input type="password" class="form-control"   class="inputxt" id="password" name="password" placeholder="(密码范围在6~15位之间)" datatype="*6-15" nullmsg="请输入密码！" errormsg="密码范围在6~15位之间！" value="">
						  </div>
						   <div class="form-group">
						    <label class="sr-only" for="rechekpassword">Password</label>
						    <input type="password" class="form-control"  name="rechekpassword" id="rechekpassword" placeholder="请确认密码"  datatype="*" nullmsg="请再次确认密码！" recheck="password" errormsg="您两次输入的账号密码不一致！" value="">
						  </div>
						  <div class="form-group">
						  	<div class="col-xs-6" style="padding-left:0 ;">
						  		<input type="tel" class="form-control" maxlength="6" id="testword" name="testword"  datatype="testCode"  errormsg="请输入正确的验证码" nullmsg="请输入验证码" placeholder="验证码">
						  	</div>
						  	<div class="col-xs-4 getCode" style="border: 1px solid #ddd;padding: 6px 12px;" ></div>
						  	<div class="col-xs-2"><a class="regetCode" onclick="getCode()"> 看不清换一张</a></div>
						    
						  </div>
							<div class="form-group">
								<button type="submit"  class="submit_btn btn btn-success center-block" style="width: 100%;">注册</button>
							</div>
						  
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!--<div id="Validform_msg"><div class="Validform_title">提示信息<a class="Validform_close" href="javascript:void(0);">χ</a></div><div class="Validform_info"></div><div class="iframe"><iframe frameborder="0" scrolling="no" height="100%" width="100%"></iframe></div></div>-->
	</body>
<script src="../js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src='../js/bootstrap.min.js'></script>
<script type="text/javascript" src="../js/newsDetails.js"></script>
<script src="../js/Validform_v5.3.2_min.js"></script>
<script>
//获取随机字符串
getCode();
var testCode = '';
function getCode(){
	$.ajax({
		type:"get",
		url:"http://114.112.96.184:18080/sys/validCode",
		async:true,
		dataType:"json",
		success:function(data){
			testCode = data.result;
			$('.getCode').text(data.result)
		}
	});
}  

	 var code = $('.getCode').text()
	$(".form-horizontal").Validform({
		ajaxPost:true,
		datatype:{
			"testCode":function(gets,obj,curform,regxp){
				console.log(gets)
				if(gets==testCode){return true}
				return false;
			}
		},
		beforeSubmit:function(curform){
	},
		callback:function(object){
		    console.log(object)
			if (object.code=='000') {
				var person = {"userid":object.result.id,"admin":object.result.admin,"invest":object.result.invest,"avatar":object.result.avatar,"startup":object.result.startup,"technical":object.result.technical,"username":object.result.username};
				console.log(person)
				if(window.sessionStorage){     
					sessionStorage.setItem("person",JSON.stringify(person));
                    window.location.href='../index.html';
				}else{
					alert("浏览暂不支持本网页，请升级浏览器或更换其他浏览器！") 
				}				
			} else{
				$('div.Validform_info').text(object.msg)
			}
			
		
		}
	});

$('.bgImage img').on('click',function () {
	window.location.href='../index.html';
})



</script>
</html>
